package com.wpp.core.result;


import lombok.Data;

/**
 * @author wpp25
 * @date 2021/5/13 21:56
 * @description：
 */
@Data
public class ResultDTO<T> {

    private Boolean success;

    private String message;

    private T data;

    public ResultDTO() {
    }

    public ResultDTO(Boolean success) {
        this.success = success;
    }

    public ResultDTO(Boolean success, String message, T t) {
        this.success = success;
        this.message = message;
        this.data = t;
    }

    public static ResultDTO successResult(){
        return new ResultDTO();
    }

    public static ResultDTO successResult(Object obj){
        return new ResultDTO(true,"",obj);
    }

    public static ResultDTO failResult() {
        return new ResultDTO(false,null,null);
    }
}
